package booroo.basic;

public class J06_Patterns {

	public static void main(String[] args) {
		// 반복문을 이용해서 다양한 패턴 출력하기
		// 패턴1 - 테스트1
		/*System.out.println("1 2 3 4 5 6");
		System.out.println("1 2 3 4 5 6");
		System.out.println("1 2 3 4 5 6");
		System.out.println("1 2 3 4 5 6");
		System.out.println("1 2 3 4 5 6");
		System.out.println("1 2 3 4 5 6");*/
		
		/*int i = 1;
		int j = 1;
		while (j <= 6){  // 행 row
			i = 1;       // 열 column
			while (i <= 6){
				System.out.print(i + " ");
				i++;
				}
		System.out.println();
		j++;
		}*/
		
		int i = 1;
		int j = 1;
		while (j <= 6){  // 행 row
			i = 1;       // 열 column
			while (i <= j){
				System.out.print(i + " ");
				i++;
			}
			System.out.println();
			j++;
		}
		System.out.println();
		// 패턴2
		int k = 1;
		int l = 6;
		while (l >= 1){  // 행 row
			k = 1;       // 열 column
			while (k <= l){
				System.out.print(k + " ");
				k++;
			}
			System.out.println();
			l--;
		}
		System.out.println();
		
		// 패턴3
		int m = 6;
		int n = 1;
		while ( n <= 6){
			while ( m >= 1){
			if ( m > n){
				System.out.print("  ");
			}
			else System.out.print(" "+m);
			m--;
			}
			System.out.println();
			m = 6;
			n++;
			}
		System.out.println();
		
		// 패턴4
		int o = 1;
		int p = 1; 
		int q = 0;
		int r = 6;
		
		while(q <= 5){
			while (p <= q){
			System.out.print("  ");
			p++;
			}
			while (o <= r){
			System.out.print(o + " ");
			o++;
			}
		q++;
		r--;
		p = 1;
		o = 1;
		System.out.println();
		}
	}
}


